﻿public static class GlobalMembersTextlayer
{
	public static _LCUI_CharData LCUI_CharData = new _LCUI_CharData();

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Init(_LCUI_TextLayer layer);
	// 初始化文本图层相关数据 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void Destroy_TextLayer(_LCUI_TextLayer layer);
	// 销毁文本图层占用的资源 

	//* 更新文本图层中的内容 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Update(_LCUI_TextLayer layer, ref LCUI_Queue dirty_rect_list);

	// 标记需要重绘整个文本图层 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Redraw(_LCUI_TextLayer layer);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Refresh(_LCUI_TextLayer layer);
	// 标记文本图层中每个字的位图，等待绘制文本图层时进行更新 

	// 
	// * 功能：设定文本图层的偏移位置
	// * 返回值：需要对图层进行重绘时返回0，否则返回1
	// *  
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_SetOffset(_LCUI_TextLayer layer, LCUI_Pos offset_pos);

	//* 设置文本图层的图像尺寸 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_SetGraphSize(_LCUI_TextLayer layer, LCUI_Size new_size);

	//* 计算文本图层的尺寸 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_GetSize(_LCUI_TextLayer layer, ref LCUI_Size layer_size);

	//* 获取文本图层的图像数据 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public struct LCUI_Graph_ TextLayer_GetGraph(_LCUI_TextLayer layer);

	// 获取文本图层中的文本内容 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public size_t TextLayer_GetText(_LCUI_TextLayer layer, ref char buff, size_t max_len);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_RefreshCharBehind(_LCUI_TextLayer layer, LCUI_Pos char_pos);
	// 刷新指定行中指定字以及后面的字的区域 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Text_SetDefaultStyle(_LCUI_TextLayer layer, LCUI_TextStyle style);
	// 设定默认的文本样式，需要调用TextLayer_Draw函数进行文本位图更新 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_ReadOnly(_LCUI_TextLayer layer, LCUI_BOOL flag);
	// 指定文本图层中的文本是否为只读 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Text_Clear(_LCUI_TextLayer layer);
	// 清空文本内容 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_SetRowEnd(_LCUI_TextLayer layer, uint row, uint start_cols);
	// 为指定行设定结束点，结束点及后面的数据将被删除，但不记录残余文本位图区域 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_Text_GetTotalLength(_LCUI_TextLayer layer);
	// 获取文本位图中的文本长度 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Text_Set_MaxLength(_LCUI_TextLayer layer, int max);
	// 设定文本位图中的文本长度 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Text_SetPasswordChar(_LCUI_TextLayer layer, char ch);
	// 
	// * 设置屏蔽字符，设置后，文本框内的文本都会显示成该字符
	// * 如果ch的值为0，则不对文本框里的文本进行屏蔽 
	// * 

	// 对文本进行预处理，处理后的数据保存至layer里  
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Text_Process(_LCUI_TextLayer layer, int pos_type, ref char new_text);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_PrintInfo(_LCUI_TextLayer layer);
	// 打印文本图层信息 

	// 
	// * 功能：设定指定的宽字符串作为文本图层中显示的文本
	// * 说明：文本将被储存至缓冲区，等待绘制文本位图时再处理缓冲区内的文本
	// *  
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_TextW(_LCUI_TextLayer layer, ref char wchar_text);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_Text(_LCUI_TextLayer layer, string utf8_text);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_TextA(_LCUI_TextLayer layer, string ascii_text);

	// 在文本末尾追加文本，不移动光标，不删除原有选中文本 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_Text_AppendW(_LCUI_TextLayer layer, ref char new_text);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_Text_AppendA(_LCUI_TextLayer layer, ref string new_text);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_Text_Append(_LCUI_TextLayer layer, ref string new_text);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_Text_AddW(_LCUI_TextLayer layer, ref char unicode_text);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_Text_AddA(_LCUI_TextLayer layer, ref string ascii_text);

	// 在光标处添加文本，如有选中文本，将被删除 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_Text_Add(_LCUI_TextLayer layer, ref string utf8_text);

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public LCUI_Pos TextLayer_Cursor_SetPixelPos(_LCUI_TextLayer layer, LCUI_Pos pixel_pos);
	// 
	// * 功能：根据传入的二维坐标，设定光标在的文本图层中的位置
	// * 说明：该位置会根据当前位置中的字体位图来调整，确保光标显示在字体位图边上，而不
	// * 会遮挡字体位图；光标在文本图层中的位置改变后，在字符串中的位置也要做相应改变，
	// * 因为文本的添加，删减，都需要以光标当前所在位置对应的字符为基础。
	// * 返回值：文本图层中对应字体位图的坐标，单位为像素
	// *  

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public LCUI_Pos TextLayer_Cursor_SetPos(_LCUI_TextLayer layer, LCUI_Pos pos);
	// 设定光标在文本框中的位置，并返回该光标的坐标，单位为像素 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_Text_Backspace(_LCUI_TextLayer layer, int n);
	// 删除光标左边处n个字符 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public LCUI_Pos TextLayer_Char_GetPixelPos(_LCUI_TextLayer layer, LCUI_Pos char_pos);
	// 获取显示出来的文字相对于文本图层的坐标，单位为像素 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public LCUI_Pos TextLayer_Cursor_GetPos(_LCUI_TextLayer layer);
	// 获取光标在文本框中的位置，也就是光标在哪一行的哪个字后面 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public LCUI_Pos TextLayer_Cursor_GetFixedPixelPos(_LCUI_TextLayer layer);
	// 获取文本图层的光标位置，单位为像素 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public LCUI_Pos TextLayer_Cursor_GetPixelPos(_LCUI_TextLayer layer);
	// 获取文本图层的光标相对于容器位置，单位为像素 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_GetRowLen(_LCUI_TextLayer layer, int row);
	// 获取指定行显式文字数 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_CurRow_GetMaxHeight(_LCUI_TextLayer layer);
	// 获取当前行的最大高度 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_GetRows(_LCUI_TextLayer layer);
	// 获取文本行数 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_GetSelectedText(_LCUI_TextLayer layer, ref string out_text);
	// 获取文本图层内被选中的文本  

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_CopySelectedText(_LCUI_TextLayer layer);
	// 复制文本图层内被选中的文本 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public int TextLayer_CutSelectedText(_LCUI_TextLayer layer);
	// 剪切文本图层内被选中的文本 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_UsingStyleTags(_LCUI_TextLayer layer, LCUI_BOOL flag);
	// 指定文本图层是否处理样式标签 

//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_SetMultiline(_LCUI_TextLayer layer, LCUI_BOOL flag);
	// 指定文本图层是否启用多行文本显示 

	//* 设置文本图层中的文本是否自动换行 
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
	//public void TextLayer_SetAutoWrap(_LCUI_TextLayer layer, LCUI_BOOL flag);

//C++ TO C# CONVERTER TODO TASK: The following statement was not recognized, possibly due to an unrecognized macro:
	
}
// ***************************************************************************
// * textlayer.h -- text bitmap layer processing module.
// * 
// * Copyright (C) 2012-2013 by
// * Liu Chao
// * 
// * This file is part of the LCUI project, and may only be used, modified, and
// * distributed under the terms of the GPLv2.
// * 
// * (GPLv2 is abbreviation of GNU General Public License Version 2)
// * 
// * By continuing to use, modify, or distribute this file you indicate that you
// * have read the license and understand and accept it fully.
// *  
// * The LCUI project is distributed in the hope that it will be useful, but 
// * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
// * or FITNESS FOR A PARTICULAR PURPOSE. See the GPL v2 for more details.
// * 
// * You should have received a copy of the GPLv2 along with this file. It is 
// * usually in the LICENSE.TXT file, If not, see <http://www.gnu.org/licenses/>.
// * ***************************************************************************

// ****************************************************************************
// * textlayer.h -- 文本图层处理模块
// *
// * 版权所有 (C) 2012-2013 归属于
// * 刘超
// * 
// * 这个文件是LCUI项目的一部分，并且只可以根据GPLv2许可协议来使用、更改和发布。
// *
// * (GPLv2 是 GNU通用公共许可证第二版 的英文缩写)
// * 
// * 继续使用、修改或发布本文件，表明您已经阅读并完全理解和接受这个许可协议。
// * 
// * LCUI 项目是基于使用目的而加以散布的，但不负任何担保责任，甚至没有适销性或特
// * 定用途的隐含担保，详情请参照GPLv2许可协议。
// *
// * 您应已收到附随于本文件的GPLv2许可协议的副本，它通常在LICENSE.TXT文件中，如果
// * 没有，请查看：<http://www.gnu.org/licenses/>. 
// * ***************************************************************************


public enum text_add_position: int
{
	AT_TEXT_LAST,
	AT_CURSOR_POS
}

public  class _LCUI_CharData
{
//C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	//public LCUI_BOOL display:1; // 标志，是否需要显示该字 
//C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	//public LCUI_BOOL need_update:1; // 标志，表示是否需要刷新该字的字体位图数据 
	//LCUI_BOOL using_quote:2;	/* 标志，表示是否引用了现成的文本样式 */

	public char char_code; // 字符码 
	//public GlobalMembersTextlayer.LCUI_FontBMP bitmap; // 字体位图数据 
	//public LCUI_TextStyle data; // 文本样式数据 
}
//*************************************

//******** 保存一行的文本数据 ************
public class _Text_RowData
{
	//public LCUI_Size max_size = new LCUI_Size(); // 记录最大尺寸 
	public LCUI_Pos_ pos = new LCUI_Pos_(); // 当前行所在的位置 
	public LCUI_Queue @string = new LCUI_Queue(); // 这个队列中的成员用于引用源文本的字体数据 
	//public GlobalMembersTextlayer.LCUI_CharData last_char; // 保存最后一个字符数据的地址，通常是换行符 
}
//*************************************

public class LCUI_TextLayer
{
	//C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	public LCUI_BOOL read_only;//:1; // 指示文本内容是否为只读 
							   //C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	public LCUI_BOOL using_code_mode;// :1; // 指示是否开启代码模式 
									 //C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	public LCUI_BOOL using_style_tags; //:1; // 指示是否处理样式标签 
									   //C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	public LCUI_BOOL enable_word_wrap;// :1; // 指示是否自动换行 
									  //C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	public LCUI_BOOL enable_multiline;// :1; // 指示是否为多行文本图层部件 
									  //C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	public LCUI_BOOL need_scroll_layer;// :1; // 指示是否需要滚动图层 
									   //C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	public LCUI_BOOL auto_wrap; //:1; // 指示是否自动换行 
								//C++ TO C# CONVERTER TODO TASK: C# does not allow bit fields:
	public LCUI_BOOL have_select; //:1; // 标记，指示是否在文本图层中选择了文本 
	//public uint32_t start = new uint32_t(); // 被选中的文本的范围 
	//public uint32_t end = new uint32_t();

	public LCUI_Queue color_keyword = new LCUI_Queue(); // 记录需要使用指定风格的关键字 
	public LCUI_Queue text_source_data = new LCUI_Queue(); // 储存文本相关数据 
	public LCUI_Queue rows_data = new LCUI_Queue(); // 储存每一行文本的数据 
	public LCUI_Queue tag_buff = new LCUI_Queue(); // 保存样式标签中表达的属性数据 
	//public LCUI_RectQueue clear_area = new LCUI_RectQueue(); // 记录需刷新的区域 

	public LCUI_Pos_ offset_pos = new LCUI_Pos_(); // 偏移位置 
	public LCUI_Pos_ old_offset_pos = new LCUI_Pos_(); // 未滚动前的偏移位置 
	//public uint32_t current_src_pos = new uint32_t(); // 当前光标在源文本中位置 
	public LCUI_Pos_ current_des_pos = new LCUI_Pos_(); // 当前光标在分段后的文本中的位置 
	//public uint32_t max_text_len = new uint32_t(); // 最大文本长度 
	//public GlobalMembersTextlayer.LCUI_CharData password_char = new GlobalMembersTextlayer.LCUI_CharData(); // 该字符用于屏蔽单行，为0时则不屏蔽 

	public LCUI_BOOL show_cursor = new LCUI_BOOL(); // 指定是否需要显示文本光标 

	//public LCUI_TextStyle default_data = new LCUI_TextStyle(); // 缺省状态下使用的文本样式数据 
	//public LCUI_Graph_ graph = new LCUI_Graph_(); // 图层数据 
}
